package com.teemo.dp.composite.demo2;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Teemo
 */
public class Composite implements Person{
    private List<Person> children = new ArrayList<>();

    @Override
    public void addChild(Person person) {
        children.add(person);
    }

    @Override
    public void eat() {
        System.out.println("吃饭");
    }

    @Override
    public void sleep() {
        System.out.println("睡觉" );
    }
}
